package com.liusand.common.thread;

import org.springframework.data.redis.core.RedisTemplate;

/**
 * @author :liusha
 * packageName :com.liusand.client.thread
 * fileName :PatientCacheThread
 * creationTime :2023/1/30 19:06
 */
public class RedisCacheThread implements Runnable{
    private RedisTemplate<String, String> redisTemplate;
    private String key;
    private String value;

    public RedisCacheThread(RedisTemplate<String, String> redisTemplate, String key, String value) {
        this.redisTemplate = redisTemplate;
        this.key = key;
        this.value = value;
    }

    @Override
    public void run() {
        redisTemplate.opsForValue().set(key, value);
    }
}
